﻿using Cofe.Core.Filter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Cofe.Core
{
    public interface IAutoEntryList : IEntryList
    {
        /// <summary>
        /// Current Status of the entries list, whether it's loading.
        /// </summary>
        StatusType Status { get; }

        /// <summary>
        /// To wait till the entries list is completed loading, one can use EntriesLock.WaitOne()
        /// </summary>
        ManualResetEvent EntriesLock { get; }

        /// <summary>
        /// This store the excepton if the auto list failed.
        /// </summary>
        Exception Error { get; }

        /// <summary>
        /// Directory to start looking.
        /// </summary>
        ICofeDirectoryInfo[] RootDirectories { get; }

        /// <summary>
        /// Determine what to include in the entries list.
        /// </summary>
        IEntryFilter[] EntryFilters { get; }

        /// <summary>
        /// Determine whether to continue lookup a directory.
        /// </summary>
        IOptionFilter[] OptionFilters { get; }

        /// <summary>
        /// Refresh Entries.
        /// </summary>
        void Refresh();
    }

    /// <summary>
    /// Entry list that added or remove by user code.
    /// </summary>
    public interface ICustomEntryList : IEntryList
    {
        void InsertRange(int index, IEnumerable<ICofeSystemInfo> entries);
        void Delete(IEntryFilter[] matchFilter);
    }

}
